﻿Imports System.IO
Public Class frmPrincipal

    Private Sub JugarToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles JugarToolStripMenuItem.Click
        frmJuego.Show()

    End Sub

    Private Sub BorrarTodasToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BorrarTodasToolStripMenuItem.Click
        mijuego.BorrarTodas()

    End Sub

    Private Sub SalirToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SalirToolStripMenuItem.Click


        Dim fich As StreamWriter

        Try
            fich = New StreamWriter("lista.txt")
            For i As Integer = 0 To mijuego.DevuelveLista.Count - 1
                fich.WriteLine(mijuego.DevuelveLista(i).Enunciado & "*" & mijuego.DevuelveLista(i).Descripcion)
            Next
        Catch ex As Exception
            Me.Close()
            MessageBox.Show("no se ha podido completar", "atencion", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End Try

        fich.Close()



        Me.Close()

    End Sub


    Private Sub BorrarPalabrasToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BorrarPalabrasToolStripMenuItem.Click
        frmAñadir.Show()
    End Sub

    Private Sub BorrarPalabrasToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BorrarPalabrasToolStripMenuItem1.Click
        frmBorrar.Show()
    End Sub

    Private Sub frmPrincipal_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub

    Private Sub ArchivoToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ArchivoToolStripMenuItem.Click

    End Sub
End Class